<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>练习</title>       <!-- 动态插入多行 -->

    <script>
        function ckicked() {
            //拿到input 输入的值
            var input1 = document.getElementById("input1")
            console.log(input1.value)

            //
            var count = input1.value

            //拿到table
            var table = document.getElementById("table1")

            tableStr = '<table id="table1" border="1px" width="500px" align="center">'

            for (var i=1; i<=count; i++) {
                tableStr += '<tr><td>第'+i+'行</td></tr>'
            }
            tableStr += `</table>`
            console.log(tableStr)

            document.write(tableStr)
        }


    </script>

</head>
<body>

行<input id="input1" type="text" name="rowNum" ><br>
列<input id="input2" type="text" name=""><br>
<button onclick="ckicked()">确定</button>

</body>
</html>